import { get, post, put, del } from "@/request";

export interface IInforTech {
  techId?: number | string | null;
  techTitle: string;
  techContent: string;
  techImg?: string;
  status?: number; // 0-无效,1-有效
  publishTime?: string;
  createTime?: string;
  updateTime?: string;
}

// 新增特色医疗技术
export const createInforTech = (data: IInforTech) => {
  return post("/information/inforTech/addInforTech", data);
};

// 删除特色医疗技术
export const deleteInforTech = (techId: number | string) => {
  return del(`/information/inforTech/${techId}`);
};

// 查询所有特色医疗技术
export const fetchAllInforTech = () => {
  return get<{ data: IInforTech[] }>("/information/inforTech");
};

// 更新特色医疗技术
export const updateInforTech = (data: IInforTech) => {
  return put("/information/inforTech/updateInforTech", data);
};

// 根据id查询特色医疗技术
export const fetchInforTechById = (techId: number | string) => {
  return get(`/information/inforTech/${techId}`);
}